package com.pj.project4sp.purchaseschedule;

import cn.dev33.satoken.stp.StpUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.pj.utils.sg.*;

/**
 * 工具类：purchase_schedule -- 采购表
 * @author shengzhang 
 *
 */
@Component
public class PurchaseScheduleUtil {


	/**
	 * 底层 Mapper 对象
	 */
	public static PurchaseScheduleMapper purchaseScheduleMapper;

	@Autowired
	private void setPurchaseScheduleMapper(PurchaseScheduleMapper purchaseScheduleMapper) {
		PurchaseScheduleUtil.purchaseScheduleMapper = purchaseScheduleMapper;
	}


	/**
	 * 将一个 PurchaseSchedule 对象进行进行数据完整性校验 (方便add/update等接口数据校验) [G]
	 */
	public static boolean check() {
		long loginIdAsLong = StpUtil.getLoginIdAsLong();
		if (!(loginIdAsLong == 10001 || loginIdAsLong == 10002)) {
			throw new AjaxError("暂无此权限,请联系管理员");
		}
		return true;
	}
	
}
